//
//  DescShowViewController.m
//  AskDoctor
//
//  Created by apple on 16/12/21.
//  Copyright © 2016年 ly. All rights reserved.
//

#import "DescShowViewController.h"

@interface DescShowViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (nonatomic, strong) NSArray *showArr;
@end

@implementation DescShowViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    self.showArr = @[@"姓名:乔布斯",@"年龄:80",@"绰号:IT之父"];
    
    UITableView *tabV = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) style:UITableViewStylePlain];
    
    tabV.delegate = self;
    tabV.dataSource = self;
    [tabV registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cellID"];
    [self.view addSubview:tabV];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 1;
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 4;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{

    //cell
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cellID"];
    
    if (indexPath.row ==0) {
        
        cell.imageView.image = [UIImage imageNamed:@"banner"];
        
    }else{
        
        cell.textLabel.text = self.showArr[indexPath.row-1];
    }
    
    
    return cell;
}

@end
